package org.kgc.alanhealth.entity;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName hospital_comments
 */
@Data
public class HospitalComments implements Serializable {
    /**
     * 评论标题
     */
    private Integer id;

    /**
     * 发帖标题
     */
    private String title;

    /**
     * 头像路径
     */
    private String headpic;

    /**
     * 用户名
     */
    private String username;

    /**
     * 内容
     */
    private String content;

    /**
     * 回复时间
     */
    private Date replydate;

    /**
     * 发布时间
     */
    private Date releasedate;

    /**
     * 人气
     */
    private Integer popularity;

    /**
     * 评论数
     */
    private Integer commentsnumber;

    /**
     * 发布图片的路径
     */
    private String picpath;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        HospitalComments other = (HospitalComments) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getHeadpic() == null ? other.getHeadpic() == null : this.getHeadpic().equals(other.getHeadpic()))
            && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getReplydate() == null ? other.getReplydate() == null : this.getReplydate().equals(other.getReplydate()))
            && (this.getReleasedate() == null ? other.getReleasedate() == null : this.getReleasedate().equals(other.getReleasedate()))
            && (this.getPopularity() == null ? other.getPopularity() == null : this.getPopularity().equals(other.getPopularity()))
            && (this.getCommentsnumber() == null ? other.getCommentsnumber() == null : this.getCommentsnumber().equals(other.getCommentsnumber()))
            && (this.getPicpath() == null ? other.getPicpath() == null : this.getPicpath().equals(other.getPicpath()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getHeadpic() == null) ? 0 : getHeadpic().hashCode());
        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getReplydate() == null) ? 0 : getReplydate().hashCode());
        result = prime * result + ((getReleasedate() == null) ? 0 : getReleasedate().hashCode());
        result = prime * result + ((getPopularity() == null) ? 0 : getPopularity().hashCode());
        result = prime * result + ((getCommentsnumber() == null) ? 0 : getCommentsnumber().hashCode());
        result = prime * result + ((getPicpath() == null) ? 0 : getPicpath().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", headpic=").append(headpic);
        sb.append(", username=").append(username);
        sb.append(", content=").append(content);
        sb.append(", replydate=").append(replydate);
        sb.append(", releasedate=").append(releasedate);
        sb.append(", popularity=").append(popularity);
        sb.append(", commentsnumber=").append(commentsnumber);
        sb.append(", picpath=").append(picpath);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}